﻿Imports QLPhuTungOto.Data
Public Class HoaDonBUS
    Dim db As New QLPhuTungOtoDataContext
    Public Sub ThemHoaDon(ByVal hd As HoaDon, ByVal l As List(Of ChiTietHoaDon))
        hd.InsertHoaDon(hd, l)
    End Sub

    Public Function LayBang() As List(Of HoaDon)
        Return db.HoaDon.ToList()
    End Function

    Public Function LayHoaDon()
        Dim hd As New HoaDon
        Return hd.LayHoaDon()
    End Function

    Public Function LayHoaDonTheoThoiGian(ByVal _from As Date, ByVal _to As Date)

        Dim hd As New HoaDon
        Return hd.LayHoaDonTheoThoiGian(_from, _to)
    End Function

    Public Function LayHoaDonTheoThoiGian(ByVal _from As Date, ByVal _to As Date, ByVal _dongbatdau As Integer, ByVal _sl As Integer)

        Dim hd As New HoaDon
        Return hd.LayHoaDonTheoThoiGian(_from, _to, _dongbatdau, _sl)
    End Function

    Public Function ThongKeDoanhThu(ByVal d As Date)
        Dim hd As New HoaDon
        Return hd.ThongKeDoanhThu(d)
    End Function

    Public Function ThongKeDoanhThu2(ByVal d As Date)
        Dim hd As New HoaDon
        Return hd.ThongKeDoanhThu2(d)
    End Function

    Public Function DemHoaDonTheoThoiGian(ByVal _from As Date, ByVal _to As Date) As Integer
        Dim hd As New HoaDon
        Return hd.DemHoaDonTheoThoiGian(_from, _to)
    End Function
End Class
